// 导入joi
const joi = require('joi')
    // 定义课程名称规则
const course_name = joi.string().required()
    // 定义课程分类
const course_cate = joi.string().required()
    // 定义课程阶段规则
const course_phase = joi.number().integer().required()
    // 定义id的验证规则
const id = joi.number().integer().required()
    // 定义course_id的验证规则
const course_id = joi.number().integer().required()

exports.add_course_schema = {
    body: {
        course_name,
        course_id,
        course_phase
    }
}
exports.update_course_schema = {
    body: {
        course_name,
        course_id,
        course_phase,
        id
    }
}

exports.get_course_schema = {
    query: {
        id
    }
}

exports.delete_course_schema = {
    body: {
        id
    }
}

exports.get_course_cate_schema = {
    query: {
        course_id
    }
}